<div class="header_menu">
    <div class="container">
        <div class="header-nav clearfix">
            <?php echo $this->partial($this->indexPartial[0]['partialFile'], $this->indexPartial[0]['partialArg']); ?>
            <div class="nav-main">
                <ul class="nav-main-list J_menuNavMain clearfix">
                    <li class="nav-main-item">
                        <a href="<?php echo $this->url('shop'); ?>"><span class="text"><?php echo $this->translate('首页'); ?></span></a>
                    </li>
                    <?php
                    $shopMiddleMenu = $this->shopHelper()->shopNavigationMenu(2);
                    if($shopMiddleMenu) {
                        foreach($shopMiddleMenu as $middleValue) {
                            $subGoodsClass = null;
                            if ($middleValue->getGoodsClassId() > 0) $subGoodsClass = $this->shopHelper()->goodsSubClass($middleValue->getGoodsClassId());
                            ?>
                            <li class="nav-main-item">
                                <a href="<?php echo $middleValue->getNavigationUrl(); ?>" <?php if($middleValue->getNewWindow() == 1) echo 'target="_blank"'; ?>><span class="text <?php if($subGoodsClass) echo 'with-submenu'; ?>"><?php echo $this->escapeHtml($middleValue->getNavigationTitle()); ?></span></a>
                                <?php
                                if ($subGoodsClass) {
                                    echo '<div class="submenu submenu-wrapper">';
                                    foreach ($subGoodsClass as $classValue) {
                                        ?>
                                        <a href="<?php echo $this->url('shop-class', ['action'=>'goodsList', 'id' => $classValue->getClassId()]); ?>" <?php if ($middleValue->getNewWindow() == 1) echo 'target="_blank"'; ?> class="basic"><?php echo $this->escapeHtml($classValue->getClassName()); ?></a>
                                    <?php } echo '</div>'; } ?>
                            </li>
                        <?php } } ?>
                </ul>
            </div>
        </div>
    </div>
</div>
</div>

<div class="container">
    <div class="row">
        <div class="col col-16 offset4">
            <div class="home-slider">
                <div class="xm-slider">
                    <div class="xm-slider-container">
                        <?php
                        $slideBody = $this->partial($this->indexPartial[1]['partialFile'], $this->indexPartial[1]['partialArg']);
                        if (!empty($slideBody)) echo $slideBody; else { ?>
                            <h2 style="text-align: center;"><a href="https://docs.loongdom.com.cn/template/pc/" target="_blank" class="btn btn-primary" style="font-size:20px;padding: 15px 15px;margin-top: 40px;"><?php echo $this->translate('还没有设置，点击查看首页设置教程'); ?></a></h2>
                        <?php } ?>
                    </div>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="home-hd-show container">
                <div class="hd-show-item hd-show-item-first">
                    <?php echo $this->partial($this->indexPartial[2]['partialFile'], $this->indexPartial[2]['partialArg']); ?>
                </div>
                <div class="hd-show-item ">
                    <?php echo $this->partial($this->indexPartial[3]['partialFile'], $this->indexPartial[3]['partialArg']); ?>
                </div>
                <div class="hd-show-item ">
                    <?php echo $this->partial($this->indexPartial[4]['partialFile'], $this->indexPartial[4]['partialArg']); ?>
                </div>
                <div class="hd-show-item ">
                    <?php echo $this->partial($this->indexPartial[5]['partialFile'], $this->indexPartial[5]['partialArg']); ?>
                </div>
            </div>
        </div>
    </div>

    <div id="floor_1" class="container row has-floor index_goods_list">
        <div class="col col-4 goods-left">
            <div>
                <div class="heading">
                    <h4 class="title">1F / <?php echo $this->partial($this->indexPartial[17]['partialFile'], $this->indexPartial[17]['partialArg']); ?></h4>
                </div>
                <?php echo $this->partial($this->indexPartial[6]['partialFile'], $this->indexPartial[6]['partialArg']); ?>
            </div>
        </div>
        <div class="col col-16 goods-right">
            <?php echo $this->partial($this->indexPartial[10]['partialFile'], $this->indexPartial[10]['partialArg']); ?>
        </div>
    </div>
    <!--1F与2F间的横幅广告-->
    <div class="container">
        <div>
            <?php echo $this->partial($this->indexPartial[14]['partialFile'], $this->indexPartial[14]['partialArg']); ?>
        </div>
    </div>
    <div id="floor_2" class="container row has-floor index_goods_list">
        <div class="col col-4 goods-left">
            <div>
                <div class="heading">
                    <h4 class="title">2F / <?php echo $this->partial($this->indexPartial[18]['partialFile'], $this->indexPartial[18]['partialArg']); ?></h4>
                </div>
                <?php echo $this->partial($this->indexPartial[7]['partialFile'], $this->indexPartial[7]['partialArg']); ?>
            </div>
        </div>
        <div class="col col-16 goods-right">
            <?php echo $this->partial($this->indexPartial[11]['partialFile'], $this->indexPartial[11]['partialArg']); ?>
        </div>
    </div>
    <!--2F与3F间的横幅广告-->
    <div class="container">
        <div>
            <?php echo $this->partial($this->indexPartial[15]['partialFile'], $this->indexPartial[15]['partialArg']); ?>
        </div>
    </div>
    <div id="floor_3" class="container row has-floor index_goods_list">
        <div class="col col-4 goods-left">
            <div>
                <div class="heading">
                    <h4 class="title">3F / <?php echo $this->partial($this->indexPartial[19]['partialFile'], $this->indexPartial[19]['partialArg']); ?></h4>
                </div>
                <?php echo $this->partial($this->indexPartial[8]['partialFile'], $this->indexPartial[8]['partialArg']); ?>
            </div>
        </div>
        <div class="col col-16 goods-right">
            <?php echo $this->partial($this->indexPartial[12]['partialFile'], $this->indexPartial[12]['partialArg']); ?>
        </div>
    </div>
    <!--3F与4F间的横幅广告-->
    <div class="container">
        <div>
            <?php echo $this->partial($this->indexPartial[16]['partialFile'], $this->indexPartial[16]['partialArg']); ?>
        </div>
    </div>
    <div id="floor_4" class="container row has-floor index_goods_list">
        <div class="col col-4 goods-left">
            <div>
                <div class="heading">
                    <h4 class="title">4F / <?php echo $this->partial($this->indexPartial[20]['partialFile'], $this->indexPartial[20]['partialArg']); ?></h4>
                </div>
                <?php echo $this->partial($this->indexPartial[9]['partialFile'], $this->indexPartial[9]['partialArg']); ?>
            </div>
        </div>
        <div class="col col-16 goods-right">
            <?php echo $this->partial($this->indexPartial[13]['partialFile'], $this->indexPartial[13]['partialArg']); ?>
        </div>
    </div>
    <div class="floors">
        <a class="floor" href="#floor_1"><span class="floor_id">1F</span><span class="floor_title"><?php echo $this->partial($this->indexPartial[17]['partialFile'], $this->indexPartial[17]['partialArg']); ?></span></a>
        <a class="floor" href="#floor_2"><span class="floor_id">2F</span><span class="floor_title"><?php echo $this->partial($this->indexPartial[18]['partialFile'], $this->indexPartial[18]['partialArg']); ?></span></a>
        <a class="floor" href="#floor_3"><span class="floor_id">3F</span><span class="floor_title"><?php echo $this->partial($this->indexPartial[19]['partialFile'], $this->indexPartial[19]['partialArg']); ?></span></a>
        <a class="floor" href="#floor_4"><span class="floor_id">4F</span><span class="floor_title"><?php echo $this->partial($this->indexPartial[20]['partialFile'], $this->indexPartial[20]['partialArg']); ?></span></a>
    </div>
</div>
<script type="text/javascript">
    $(window).load(function() {
        $('.flexslider').flexslider({
            animation: "slide",
            controlNav: false,
            slideshowSpeed: 4000
        });
    });

    $('.nav-category-section').moreContent({
        height: 400,
        textClose: '︾',
        textOpen: '︽'
    });

    $(document).ready(function() {
        if ($(window).width() >= 768) {
            let first_floor_element_offset = $('#floor_1').offset();
            $('.floors').css('left', parseInt(first_floor_element_offset.left) - 50 + 'px');

            $('.floors a').click(function(e) {
                $('html, body').animate({ scrollTop: parseInt($($(this).attr('href')).offset().top) - 20 }, 600);
                return false;
            });

            $(window).scroll(function () {
                let window_top = $(window).scrollTop();
                $('.has-floor').each(function (i) {
                    let page_builder_wrapper_top = $(this).offset().top;

                    if (window_top > page_builder_wrapper_top - 300) {
                        $('.floors a:eq(' + i + ')').addClass('floor-active').siblings('a').removeClass('floor-active');
                    }
                });
            });
        } else {
            $('.floors').css('display','none');
        }
    });
</script>